﻿using System;
using System.Linq;

namespace Extentions
{
    public static partial class Linq
    {
        /// <summary>
        /// Returns if the specified source is any of.
        /// if (flag == 1 || flag == 2 || flag == 3 || flag == 4) { .. }
        /// if (flag.IsAny(1, 2, 3, 4)) { .. }
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="source">The source.</param>
        /// <param name="parms">The parms.</param>
        /// <returns>
        /// 	<c>true</c> if the specified source is any; otherwise, <c>false</c>.
        /// </returns>
        public static bool IsAny<T>(this T source, params T[] parms)
        {
            return parms.Contains(source);
        }
    }
}